home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / flilib.zip / AADOS.H next >
C/C++ Source or Header  |  1993-02-09  |  3KB  |  96 lines

  1. /* aados.h  Copyright 1990 Dancing Flame, San Francisco */
  2.  
  3. #ifndef AADOS_H
  4. #define AADOS_H
  5.  
  6. #ifndef AATYPES_H
  7. #include "aatypes.h"
  8. #endif /* AATYPES_H */
  9.  
  10. typedef int Jfile;
  11.  
  12. dos_key_is(void);  /* return 1 if a key is ready to read, 0 if not */
  13. dos_key_in(void);  /* return next keyboard input.  Wait for it. */    
  14.  
  15. Jfile dos_open(char *title, int mode); /* open a file that already exists.*/
  16. /* defines for mode parameter to dos_open  */
  17. #define DOS_READ_ONLY 0
  18. #define DOS_WRITE_ONLY 1
  19. #define DOS_READ_WRITE 2
  20.  
  21. Jfile dos_create(char *title);    /* Create a new read/write file */
  22. void dos_close(Jfile f);        /* close file */
  23.  
  24. /* File read/write.  Normally don't use dos_rw, but go through macros */
  25. long dos_rw(Jfile f,void *buf,long size,int ah);
  26. #define dos_read(f,b,size) dos_rw(f,b,size,0x3f)
  27. #define dos_write(f,b,size) dos_rw(f,b,size,0x40)
  28.  
  29. long dos_seek (Jfile f, long offset, int mode);
  30. long dos_tell (Jfile f);
  31. /* defines for mode parameter to dos_seek  */
  32. #define DOS_SEEK_START    0
  33. #define DOS_SEEK_RELATIVE    1
  34. #define DOS_SEEK_END    2
  35.  
  36.  
  37. /* size of a buffer long enough to hold any MS-DOS path */
  38. #define DOS_PATH_SIZE 80
  39.  
  40. /* this is the data structure used by dos_first() dos_next () in searching
  41.    directories */
  42. typedef struct fndata 
  43.     {
  44.     char reserved[21];
  45.     char attribute;
  46.     USHORT time, date;
  47.     long size;
  48.     char name[13];
  49.     char fordos[128-43];
  50.     } Fndata;
  51.  
  52. Fndata *dos_get_dta (void); /* get the 'DTA' area for directory search */
  53. Boolean dos_first(char *pattern, int attributes);
  54. /* defines for attributes parameters */
  55. #define DOS_ATTR_DIR    16
  56. #define DOS_ATTR_NORMAL  0
  57. Boolean dos_next (void);
  58.  
  59.  
  60. /* A list of dos_devices that are actually connected, 
  61.     made by dos_get_devlist () */
  62. extern char dos_devices[26];
  63. extern int dos_dev_count;
  64. void dos_get_devlist (void);
  65.  
  66. /* This gets rid of the ms-dos abort/retry/fail message.  Afterwards
  67.    ms-dos acts like it was always a fail.  dos_get_devlist () calls this... */
  68. void dos_no_abort_retry_cancel (void); 
  69.  
  70. /* Hey dos - I want to go to this directory.  Actually this changes
  71.    both device and directory at once.  eg name could be
  72.            C:\VPAINT\FISHIES  */
  73. Boolean dos_change_dir(char *name);
  74.  
  75. /* Tell DOS it's time to go to another drive mon.  0 = A:, 1 = B: ...
  76.    you get the idea */
  77. Boolean dos_change_dev(int newdev);
  78.  
  79. /* Hey DOS, what drive is we on? 0 = A: */
  80. int dos_get_dev (void);
  81.  
  82. /* Get the current device and directory into path */
  83. Boolean dos_get_dir (char path[DOS_PATH_SIZE]);
  84.  
  85. /* Create a directory.  (Don't include device info.  If needed
  86.    do a dos_change_dev(dev) first.) */
  87. Boolean dos_make_dir(char *name);
  88.  
  89. /* Delete a directory. */
  90. Boolean dos_del_dir(char *name);
  91.  
  92. /* Figure how much free space is on a device.  0 = current device. 1 = A:... */
  93. long dos_dfree(int dev);
  94.  
  95. #endif /* AADOS_H */
  96.